package com.repository;

import com.entity.SysHistoryAndPackageVersion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author Yadasu
 * @date 2021/1/26 9:59
 */
public interface SysHistoryAndPackageVersionRepository extends JpaRepository<SysHistoryAndPackageVersion, Integer> {
    @Query(value = "SELECT * FROM `sys_history_package_version` WHERE deploy_id=?1", nativeQuery = true)
    SysHistoryAndPackageVersion findByDeployId(Integer id);


    @Query(value = "select * from `sys_history_package_version`where deploy_id=?1 and history_id=?2 ", nativeQuery = true)
    SysHistoryAndPackageVersion findByDeployIdAndHistoryId(Integer deployId, Integer historyId);
}
